// Promise.allSettled() 等待所有 Promise 完成（无论成功失败）
const promises = [
    Promise.resolve(1),
    Promise.reject('失败'),
    Promise.resolve(3)
];

Promise.allSettled(promises)
    .then(results => {
        console.log(results);
        // [
        //   { status: 'fulfilled', value: 1 },
        //   { status: 'rejected', reason: '失败' },
        //   { status: 'fulfilled', value: 3 }
        // ]
    });